﻿using Hospital.IRepository;
using Hospital.Model.entity;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Hospital.Repository
{
    public class WardRepository : BaseRepository<Ward>, IWardRepository
    {
        public WardRepository(ISqlSugarClient db) : base(db)
        {
        }
        public override async Task<List<Ward>> QueryAsync()
        {
            return await base.Context.Queryable<Ward>()
                .Where(ward => ward.IsDeleted == false)
                .Mapper(ward => ward.Department, ward => ward.DepartmentId, ward => ward.Department.Id)
                .ToListAsync();
        }
    }
}
